<?php

namespace App\Services\Interfaces;

use Illuminate\Database\Eloquent\Model;

/**
 * Interface RepoServiceInterface
 * @package App\Services\Interfaces
 * 各资源仓库的CRUD操作, 用来根据权限操作指定范围的数据
 */
interface RepoServiceInterface
{
    public function create(array $_options=null):Model;
    public function read($limit=0);
    public function find(array $_filter);

    /**
     * @param array $_filter
     * @param array $_update_data
     * @return bool
     * <code>
     * $instance->update(['id'=>'xxx'], ['name'=>'newName']);
     * </code>
     */
    public function update(array $_filter, array $_update_data):bool;
    public function delete(array $_filter):bool;
}